 {include file="index@public/header" /}
  <style>
    ::-webkit-scrollbar{
    width:8px;
    height: 6px;
  }
  ::-webkit-scrollbar-thumb{
    border-radius: 10px;
    box-shadow: 0 0 1px rgb(255 255 255 / 50%);
    background-color: rgba(0, 0, 0, .2);
  }
  ::-webkit-scrollbar-track-piece{
    border-radius: 10px;
    box-shadow: 0 0 1px rgb(255 255 255 / 50%);
    background-color: #ededed;
  }
  
  @media screen and (min-width: 768px) {
    .pc-list{display: block;}
    .phone-list{display: none;}
    .phone-balllist-tab{display: none;}
  }
  @media screen and (max-width: 768px) {
      .pc-list{display: none;}
      .phone-list{display: block;}
      .phone-balllist-tab{display: block;}
  }
  
  .selall img{float: left;margin-top:2px;}
  .selzhi{
    color:#36648a;text-decoration:none;font: 12px/14px arial,helvetica,sans-serif;
    display: inline-block;
    width:100%;
    float: left;
  }
  /*.selzhi:hover{
     background-color: #36648a;
  }*/
  /*.selall:hover{
    background-color: #36648a;
  }*/
  .selall:hover{
    background-color: #36648a;
  }
  .selall:hover a{
    color: #ffffff;
  }
  body{background-color:#ffffff}
  .gaol{background-color: #EFEFEF;}
  .delail_list{margin-top:10px;cursor:pointer;}
  .Part_No {color:#36648a;}
  .delail_list .price-a{color:#19792f}
  .delail_list:hover{background-color: #36648a;}
  .delail_list:hover div {color:#ffffff;background-color: #36648a;}

   #gengduoli {padding: 3px;}
   #gengduoli>.gengduoli,  #gengduoli1>.gengduoli {
      text-align: justify;
      max-width: 1230px;
      width: 98%;
  }
  #gengduoli>.gengduoli *{
    margin: unset;
    padding: revert;
  }

  #gengduoli1>.gengduoli *{
    margin: unset;
    padding: revert;
    list-style: revert;
  }
.balllist .balllist-a a{display:block;}
.balllist .balllist-a a:hover{color:#36648A;}
.balllist .balllist-a a:hover .plist{border:1px solid #36648A;}
.balllist-a{
  padding: 5px 8px;
  font-family: Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
}
.balllist-h{
  margin-left: 5px;
  padding-bottom:2px;
 }
          
.plist{
  height: 120px;
  border:1px solid #ccc;
  border-radius: 8px;
  padding:10px 5px 5px 5px;
  display: flex;
}
.plist-left{
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plist-right{
  flex:3;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plist-title{
  width: 100%;
  padding-bottom: 5px;
 font: 14px/16px Titillium Web,sans-serif;
}
          
.plist-desc{
  color: #333;
  line-height:16px;
}
.plist-icon img{
  max-width: 75%;
  object-fit: contain;
  object-position: 50% 50%;
}
.balllist a{text-decoration:none;}

@media screen and (max-width:768px) {
  .balllist .balllist-a .plist{padding:3px;}
  .balllist .balllist-a .plist .plist-title{padding-bottom:2px;font-size:14px}
}
.layui-flow-more {position:absolute;left: calc(50% - 60px);width:120px;}
#demo3 {margin-top:27px;display: flex;justify-content: center;}
#demo3 .layui-laypage .layui-laypage-curr .layui-laypage-em{background-color: #36648a;}
         
/*分页*/
.pagination{height: 20px;line-height:20px;}
.pagination li { float: left;text-align:center;cursor:pointer; padding: 0px 5px;}
.pagination li a{width:100%;height:100%;display:inline-block;text-decoration: none;}          
.pagination .disabled{color:#e2e2e2}
.pagination .active{text-decoration: underline;}
.balllist .balllist-a a{display:block;}
          .balllist .balllist-a a:hover{color:#36648A;}
          .balllist .balllist-a a:hover .plist{border:1px solid #36648A;}
          .balllist-a{
            padding: 5px 8px;
            font-family: Helvetica Neue, Helvetica, PingFang SC, Tahoma, Arial, sans-serif;
          }
          .balllist-h{
            margin-left: 5px;
            padding-bottom:2px;
          }
          
          .plist{
            height: 120px;
            border:1px solid #ccc;
            border-radius: 8px;
            padding:10px 5px 5px 5px;
            display: flex;
          }
          .plist-left{
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
          }
          .plist-right{
            flex:3;
            overflow: hidden;
            text-overflow: ellipsis;
          }
          .plist-title{
            width: 100%;
            padding-bottom: 5px;
            font: 14px/16px Titillium Web,sans-serif;
          }
          
          .plist-desc{
            color: #333;
            
            line-height:16px;
          }
          .plist-icon img{
            max-width: 75%;
            object-fit: contain;
            object-position: 50% 50%;
          }
          .balllist a{text-decoration:none;}

          @media screen and (max-width:768px) {
            .balllist .balllist-a .plist{padding:3px;}
            .balllist .balllist-a .plist .plist-title{padding-bottom:2px;font-size:14px}
          }
          .layui-flow-more {position:absolute;left: calc(50% - 60px);width:120px;}
          #demo3 {margin-top:27px;display: flex;justify-content: center;}
          #demo3 .layui-laypage .layui-laypage-curr .layui-laypage-em{background-color: #36648a;}
         

            /*分页*/
            .pagination{height: 20px;line-height:20px;}
            .pagination li { float: left;text-align:center;cursor:pointer; padding: 0px 5px;}
            .pagination li a{width:100%;height:100%;display:inline-block;text-decoration: none;}
            
            .pagination .disabled{color:#e2e2e2}
            .pagination .active{text-decoration: underline;}
  </style>


<div class='phone-list' style='font: 12px/14px arial,helvetica,sans-serif;padding:10px;background-color: #ffffff;'>
<div class='firstbreadcrumb' style="padding: 10px;">
  {foreach $crumbs as $k=>$v }
    <?php if($k!=count($crumbs)-1){?>
    <a href="/{$v['crumbs_url']}" style="font: 14px arial,helvetica,sans-serif;color:#36648A;padding-right: 8px;display: inline-block;height: 48px;line-height: 48px">{$v['alias_name']}</a> <span style="padding-right:8px;padding-bottom: 8px;display: inline-block;"> / </span>
    <?php }else{ ?>
    <span style="font: 14px arial,helvetica,sans-serif;color: #666;"><cite>{$class_info['alias_name']}</cite></span> 
    <?php } ?>  
  {/foreach} 
</div>
 
  
  <div style="padding:12px 0px">
    <div>
      <h1 style="font-size:16px;font-weight:bold;">{$class_info['alias_name']}</h1>
    </div>
    <div style="padding:3px 0px">
      
      {foreach $listkey as $key=>$vo }

      <?php if($vo['wname']=='Bore Dia'||$vo['wname']=='Outer Dia'||$vo['wname']=='Width'){?>
      <?php if(!empty($vo['data'])){?>
      <select aria-label="{$vo['wname']}" style="width:24%;height:30px;" onchange="window.location=this.value">
        <option>{:lang(trim($vo['wname']))}</option>
        {foreach $vo['data'] as $k1=>$v1 }
        <?php if(!empty($v1['key'])&&$v1['key']!=''){ ?>

        <?php 
          if($vo['is_nosearch']==1){
            $nosearch=Db::table('lily_listkey_nosearch')->field('url')->where([['list_key_id','=',$vo['id']],['value','=',$v1['key']]])->find();
            if(!empty($nosearch)){
              $shai_url=$nosearch['url'];
            }else{
              $shai_url='';
            }
          }else{
            if(empty($get)){
                $shai_url=$base_data['no_parameter_url'].'?'.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
            }else{
                $shai_url=$base_data['no_parameter_url'].'?';
                foreach ($get as $getkey => $getvalue) {
                    if($getkey=='part_number'){ $getkey='p';}
                      if($getkey!=str_replace(' ','_',$vo['wname'])){
                          $shai_url.=$getkey.'='.$getvalue.'&';
                      }
                }
                if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key']){
                    $shai_url=rtrim(rtrim($shai_url,'&'),'?');
                }else{
                    $shai_url=$shai_url.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
                }
            }
          } ?>
           
          <?php if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key'] ){?>
          <option value="{$shai_url}" selected="selected">{:lang($v1['key'])}</option>
          <?php }else{ ?>
          <option value="{$shai_url}">{:lang($v1['key'])}</option>
          <?php } ?>
            
         
        <?php }?>
        {/foreach}
        
      </select>
      <?php } ?>
      <?php } ?>
      {/foreach}
      
      <div style="width:25%;float:right;">
        <button style="height:30px;width:100%;" style="button" id="select_more_wd_a">更多筛选</button>
        <button style="height:30px;width:100%;display:none;" style="button" id="select_more_wd_b">关闭筛选</button>
      </div>
      
      <div class='clear'></div>
      <div style='display:none;' id="more_wd">
        <div style='width:100%;border:1px solid black;background-color:#efefef;padding:2px 0px;color:#333333;max-height:100px;overflow-x: hidden;;overflow-y:auto;z-index:10;font-size:14px;'>
          {foreach $listkey as $key=>$vo }
          <?php if($vo['wname']!='Bore_Dia'&&$vo['wname']!='Outer_Dia'&&$vo['wname']!='Width'){?>
          <?php if(!empty($vo['data'])){?>
          <select style="height:30px;margin:3px 0px;" onchange="window.location=this.value">
            <option>{:lang(trim($vo['wname']))}</option>
            {foreach $vo['data'] as $k1=>$v1 }
            <?php if(!empty($v1['key'])&&$v1['key']!=''){ ?>
            <?php 
              if($vo['is_nosearch']==1){
                $nosearch=Db::table('lily_listkey_nosearch')->field('url')->where([['list_key_id','=',$vo['id']],['value','=',$v1['key']]])->find();
                if(!empty($nosearch)){
                  $shai_url=$nosearch['url'];
                }else{
                  $shai_url='';
                }
              }else{
                if(empty($get)){
                    $shai_url=$base_data['no_parameter_url'].'?'.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
                }else{
                    $shai_url=$base_data['no_parameter_url'].'?';
                    foreach ($get as $getkey => $getvalue) {
                        if($getkey=='part_number'){ $getkey='p';}
                          if($getkey!=str_replace(' ','_',$vo['wname'])){
                              $shai_url.=$getkey.'='.$getvalue.'&';
                          }
                    }
                    if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key']){
                        $shai_url=rtrim(rtrim($shai_url,'&'),'?');
                    }else{
                        $shai_url=$shai_url.trim(str_replace(' ','_',$vo['wname'])).'='.trim($v1['key']);
                      }
                  }
               }?>
          
            <?php if(isset($get[str_replace(' ','_',$vo['wname'])]) && $get[str_replace(' ','_',$vo['wname'])]==$v1['key']){?>
                      <option value="{$shai_url}" selected="selected">{:lang($v1['key'])}</option>
            <?php }else{ ?>
            <option value="{$shai_url}">{:lang($v1['key'])}</option>
            <?php } ?>

            <?php }?>
        {/foreach}
          </select>
          <?php } ?>
          <?php } ?>
          {/foreach}
        </div>
      </div>
      
    <div class="layui-card-body">
          <div class="layui-row">
            
            
            <div class="layui-row balllist">
                <?php if(!empty($class_notag)){?>
                <div class="balllist-body">
                {foreach $class_notag as $key=>$value }
                    <div class="layui-col-sm3 layui-col-xs12 balllist-a">
                        <a href="/{$value['first']['class_url']}">
                            <div class="plist">
                                <div class="plist-left plist-icon">
                                  <img src="{:Config::get('app.images_host').$value['first']['img']}?format=webp" alt="{$value['first']['alias_name']}">
                                </div>
                                <div class="plist-right">
                                    <div class="plist-title">{$value['first']['alias_name']}</div>
                                    <div class="plist-desc">{$value['first']['block_des']}</div>
                                </div>
                            </div>
                        </a>
                    </div>
                {/foreach}
                    <div style="clear:both;"></div>
                </div>
                <?php } ?>
                <?php if(!empty($class_tag)){?>
                {foreach $class_tag as $key=>$value }
                <div class="balllist-h">
                    <h2 style="font-size:18px;margin-top:10px;padding-left:5px;float: left;margin-right: 10px;">{$value['first']['alias_name']}</h2>
                    <div style="clear:both;"></div>
                </div>
           
               <div class="balllist-body">
               {foreach $value['second'] as $k=>$v }
                    <div class="layui-col-sm3 layui-col-xs12 balllist-a">
                        <a href="/{$v['class_url']}">
                            <div class="plist">
                                <div class="plist-left plist-icon">
                                  <img src="{:Config::get('app.images_host').$v['img']}?format=webp" alt="{$v['alias_name']}">
                                </div>
                                <div class="plist-right">
                                    <div class="plist-title">{$v['alias_name']}</div>
                                    <div class="plist-desc">{$v['block_des']}</div>
                                </div>
                            </div>
                        </a>
                    </div>
                {/foreach}
                    <div style="clear:both;"></div>
                </div>
                {/foreach}
                <?php } ?>
            </div>
            
          </div>
        </div>
  </div>
</div>


{include file="index@public/footer" /}
<script>
  layui.use("element", function () {
    var element = layui.element;
        
  });
  var LAY_demo1_width=$("#LAY_demo1").width();
  $('#demo3').width(LAY_demo1_width);
</script>

<script type="text/javascript">
 $(document).ready(function(){
  $("#deltail_des_a").click(function(){
    $("#deltail_des_c").show();
    $("#deltail_des_a").hide();
    $("#deltail_des_b").show();
  });
  $("#deltail_des_b").click(function(){
    $("#deltail_des_c").hide();
    $("#deltail_des_a").show();
    $("#deltail_des_b").hide();
  });

  $("#select_more_wd_a").click(function(){
    $("#more_wd").show();
    $("#select_more_wd_a").hide();
    $("#select_more_wd_b").show();
  });
  $("#select_more_wd_b").click(function(){
    $("#more_wd").hide();
    $("#select_more_wd_a").show();
    $("#select_more_wd_b").hide();
  });
});


function clearall() {
    layer.load(1, {
      shade: [0.1, '#fff'],
      success: function() {
        setTimeout(function() {
          var url = window.location.href; //获取当前页面的url
          if (url.indexOf("?") != -1) { //判断是否存在参数
            url = url.replace(/(\?|#)[^'"]*/, ''); //去除参数
          }
          window.location.href = url;
        }, 1000);
      }
  });
}

/*单个清空*/
function del_search($k, $v) {
    if($k=='Part_Number'){
      $k='p';
    }
    var url = window.location.href; //获取当前页面的url
    let arrUrl = [];
    let changUrl = ''
    if (url.indexOf("?") != -1) { //判断是否存在参数
      arrUrl = url.split('?')[1].split('&')
      //获取参数转换为object
      for (var i = 0; i < arrUrl.length; i++) {
        arrUrl[i] = arrUrl[i].split("=");
      };
      for (var i = 0; i < arrUrl.length; i++) {
        if(arrUrl[i][0]==encodeURI($k)){
                    arrUrl.splice(i,1);
        }
      }
      if(arrUrl.length == 0){
        url = url.split('?')[0];
      }else{
        for (var i = 0; i < arrUrl.length; i++) {
          changUrl+=arrUrl[i][0]+'='+arrUrl[i][1]+'&';
        }

        url=url.split('?')[0]+'?'+changUrl.slice(0, changUrl.length - 1);
      }
      window.location.href=url;
    }
}

</script>
